function savefig_fct(name,openfig)

name_fig=[name '.fig'];
name_pdf=[name '.pdf'];
name_eps=[name '.eps'];

set(gcf,'FileName',name_fig);
set(gcf,'name',name_fig);
saveas(gcf,name_fig);

set(gcf,'PaperPositionMode','manual');
set(gcf,'PaperUnits','centimeters');
set(gcf,'PaperType','A4');
set(gcf,'PaperPosition',[ 2 9 17 12]);

print('-dpdf',name_pdf);
print('-depsc2',name_eps);

if openfig ~=1,
    close;
end;

    %



